package com.zxx.pattern.buildPattern.build2;

/**
 * 导演类
 *
 * @author zxx on 2020/12/11
 */
public class Director2 {

    Builder2 mBuilder2;

    public Director2(Builder2 mBuilder2) {
        this.mBuilder2 = mBuilder2;
    }

    public Product2 createComputer(String cpu, String mainBoard, String ram) {
        System.out.println("Preparing Component For ");
        this.mBuilder2.buildCpu(cpu);
        this.mBuilder2.buildMainBoard(mainBoard);
        this.mBuilder2.buildRam(ram);

        return mBuilder2.create();
    }
}
